package baseKnowledge.niukeTest;

public class CharToString {
    public static void main(String[] args){
        char myChar='g';
        /**
         * valueOf:将字符换成字符串
         */
        String myStr=Character.toString(myChar);
        System.out.println("String is:"+myStr);
        /**
         * valueOf:将字符换成字符串
         */
        myStr=String.valueOf(myChar);
        System.out.println("String is:"+myStr);

        /**
         * 将字符串转换为数字
         */
        Integer myInt;
        String str="123";
        myInt=Integer.valueOf(str);
        System.out.println("myInt:"+myInt);
    }
}
